package com.homwee.factory;

import com.homwee.tvap.common.ap.ComSettingManager;
import com.homwee.tvap.common.srvfunc.FactorySetting;

import android.app.Dialog;
import android.content.Context;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;


public class FactoryInput extends Dialog {
	
	public ComSettingManager mcomSettingManager;
	public FactorySetting factorySetting;
	public EditText mEditText;
	Button mButton1;
	Button mButton2;
	public String mInputStr =null;
	public FactoryInput(Context context) {
    	super(context, R.style.Theme_FactorySettingDialog);    	
    	setContentView(R.layout.factory_input);
    	mEditText =(EditText) findViewById(R.id.editText1);
    	mButton1 =(Button) findViewById(R.id.button1);
    	mButton2 =(Button) findViewById(R.id.button2);
    	    	
    	mButton1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				mInputStr =mEditText.getText().toString();
				cancel();
			}
		});
    	mButton2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				cancel();
			}
		});
    	
	}
	
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		// TODO Auto-generated method stub
		Log.v("tv","FactoryInput onKeyDown");
		switch (keyCode) {
		case KeyEvent.KEYCODE_BACK:
			cancel();
			break;
		default:
			break;
		}
		return super.onKeyDown(keyCode, event);
	}

}

